﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace lcmyjobs.Web.invite
{
    public partial class newuser : BasePage
    {
        lcmyjobs.BLL.user_basic bub = new BLL.user_basic();
        DataSet ds;
        int count = 0;
        lcmyjobs.BLL.news bn = new BLL.news();
        int id;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                this.Title = string.Format("{1}人才网   {1}招聘网   {1}求职网  {1}猎头网   {0}—最新人才信息", Application["webname"].ToString(), Application["webregion"].ToString());
                id = int.Parse(Application["webid"].ToString());
                Repeater1.DataSource = bn.GetListNews(id, 6, 5);
                Repeater1.DataBind();
                getcout(id);
                //bindData(); //使用url分页，只需在分页事件处理程序中绑定数据即可，无需在Page_Load中绑定，否则会导致数据被绑定两次
            }
        }
        protected void getcout(int atid)
        {
            ds = bub.PageUserNew(atid, 1, AspNetPager1.PageSize, out count);
            AspNetPager1.RecordCount = count;
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

        }
        protected void bind(int atid)
        {
            ds = bub.PageUserNew(atid, AspNetPager1.StartRecordIndex, AspNetPager1.PageSize, out count);
            AspNetPager1.RecordCount = count;
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

        }



        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            id = int.Parse(Application["webid"].ToString());
            bind(id);
        }

    }
}